package i_iterator.a_design_pattern;

/**
 * Created by wug on 2016/7/13 0013.
 */
public class MyArrListIterator<T> implements MyIterator {
    T[] array;
    int index=0;

    public MyArrListIterator(T[] array) {
        this.array = array;
    }

    @Override
    public boolean hasNext() {
        if (null != array[index]) {
            return true;
        }
        return false;
    }

    @Override
    public T next() {
        index++;
        return array[index-1];
    }
}
